﻿Public Class Cliente
    Private _nombre As String
    Private _telefono As String
    Private _importeVentas As Double

    Public Property Nombre() As String
        Get
            Return _nombre
        End Get
        Set(ByVal value As String)
            _nombre = value
        End Set
    End Property

    Public Property Telefono() As String
        Get
            Return _telefono
        End Get
        Set(ByVal value As String)
            _telefono = value
        End Set
    End Property

    Public Property ImporteVentas() As Double
        Get
            Return _importeVentas
        End Get
        Set(ByVal value As Double)
            _importeVentas = value
        End Set
    End Property

    Public Function ObtenerMemento() As MementoCliente
        Return New MementoCliente(Nombre, Telefono, ImporteVentas)
    End Function

    Public Sub RestaurarMemento(ByVal memento As MementoCliente)
        Output.Print(String.Format("Memento a restaurar {0}, {1}, {2}", Me.Nombre, Me.Telefono, Me.ImporteVentas))
        Me.Nombre = memento.Nombre
        Me.Telefono = memento.Telefono
        Me.ImporteVentas = memento.ImporteVentas
        Output.Print(String.Format("Memento restaurado {0}, {1}, {2}", Me.Nombre, Me.Telefono, Me.ImporteVentas))
    End Sub
End Class
